<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="../common/common.jsp"%>
<link rel="stylesheet" href="${ctx}/page/shop/css/shopIndex.css">
<script type="text/javascript" src="${ctx}/page/shop/js/shopIndex.js"></script>

<title>店铺</title>
</head>
<body>
		<%@ include file="../common/header.jsp"%>
		<div class="container">
			<div class="row">
				<div class="col-md-9">
					<div class="panel panel-default">
						<ul class="nav nav-tabs" role="tablist">
							<li role="presentation"> <a style="color: #333333" href="${ctx}/shop/index">首页</a></li>
							<c:forEach items="${categories}" var="category">
								<li role="presentation" class="<c:if test='${categoryId eq category.id}'>active</c:if>"> <a style="color: #333333" href="${ctx}/shop/index?categoryId=${category.id}">${category.name}</a></li>
							</c:forEach>
						</ul>
						<div class="panel-body">
							<div class="row">
								<c:forEach items="${productPage.list}" var="product">
									<div class="col-sm-6 col-md-4">
										<div class="thumbnail item">
											<a href="${ctx}/product/${product.id}">
												<img data-src="${product.listImage}" src="${product.listImage}"  data-holder-rendered="true" style="height: 200px; width: 100%; display: block;">
											</a>
											<div class="caption">
												<span class="productName">
													<a style="color: #666666" href="${ctx}/product/${product.id}">
														${product.name}
														<c:if test="${product.skuValue1 ne '默认'}">
															&nbsp${product.skuValue1}${product.skuValue2}
														</c:if>
													</a>
												</span>
												<p class="price">&yen<fmt:formatNumber type="number" value="${product.price}" pattern="0.00" maxFractionDigits="2"/><p>
												<div class="buttons">
													<button onclick="buyNow('${product.id}','${product.productSkuRelationId}')" class="btn btn-danger" role="button">立即购买</button>
													<button onclick="addCart('${product.id}','${product.name}', '${product.price}','${product.smallImage}','${product.productSkuRelationId}')" class="btn btn-success" role="button">加入购物车</button>
												</div>
											</div>
										</div>
									</div>
								</c:forEach>
							</div>
						</div>
					</div>
				</div>
				<div class="col-md-3 hidden-sm hidden-xs">
					<%@ include file="../include/welcomeInShop.jsp"%>
					<c:if test="${member ne null}">
					<%@ include file="../include/memberInfoInShop.jsp"%>
					</c:if>
					<%@ include file="../include/myShoppingCart.jsp"%>
				</div>
			</div>
		</div>
		<%@ include file="../common/footer.jsp"%>
</body>
</html>